package crp.core.space.domain.services;

import crp.core.space.domain.models.SpaceEntity;
import crp.core.space.domain.repositories.SpaceRepository;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import java.util.Collection;
import java.util.stream.Stream;

@ApplicationScoped
public class SpaceSearcher {
    private final SpaceRepository spaceRepository;

    @Inject
    public SpaceSearcher(SpaceRepository spaceRepository) {
        this.spaceRepository = spaceRepository;
    }

    public Stream<SpaceEntity> findByIds(Collection<String> ids) {
        return spaceRepository.findByIds(ids);
    }
}
